home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group97a.txt / 000007_icon-group-sender _Fri Jan 3 17:35:32 1997.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Mon, 6 Jan 1997 06:19:53 MST
  2. To: icon-group@cs.arizona.edu
  3. Date: Fri, 03 Jan 1997 17:35:32 -0800
  4. From: Stuart Robinson <robinstu@ohsu.edu>
  5. Message-Id: <32CDB3E4.3358@ohsu.edu>
  6. Organization: Oregon Health Sciences University
  7. Sender: icon-group-request@cs.arizona.edu
  8. Reply-To: robinstu@ohsu.edu
  9. Subject: Another Question from the Neophyte
  10. Errors-To: icon-group-errors@cs.arizona.edu
  11. Status: RO
  12. Content-Length: 1171
  13.  
  14. Hello.  My last posting was promptly responded to.  Thanks.  I think
  15. I've nearly solved all of the problems with the program.  Once it is
  16. finished, I will post it to the newsgroup for anyone interested.
  17.  
  18. But I've run into a new problem.  I have found numerous options for
  19. scanning forward in a string, but I haven't found a good way to move
  20. backwards, besides first reversing a string and then scanning forward
  21. (which is functionally scanning backwards).
  22.  
  23. For example, I created the following little program to extract the names
  24. of some functions nestled at the end of some lines of HTML (see input
  25. below):
  26.  
  27. =======================
  28. procedure main()
  29.  
  30. while line := reverse(read()) do
  31. line ?
  32.  
  33. {
  34. write(reverse(tab(upto(" "))))
  35. }
  36.  
  37. end
  38. =======================
  39.  
  40. Example input:
  41.  
  42. <LI><a name="1" href="#a">convert to cset</A> cset()
  43. <LI><a name="2" href="#b">convert to string</A> string()
  44. <LI><a name="3" href="#c">find string</A> find()
  45. etc.
  46.  
  47. Example output:
  48.  
  49. cset()
  50. string()
  51. find()
  52. etc.
  53.  
  54. I did manage to find a solution, but isn't there less cumbersome way of
  55. scanning backwards than using reverse()?
  56.  
  57. Thanks in advance.
  58.  
  59. Stuart Robinson
  60. srobinso@reed.edu, robinstu@ohsu.edu
  61.